<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <!-- MOTW-DISABLED saved from url=(0014)about:internet -->
    <title>Choosing between JavaScript and Java</title>
    <link rel="StyleSheet" href="css/UsingScripting.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="webworks.css" type="text/css" media="all" />
    <script type="text/javascript" language="JavaScript1.2">
      <!--
        var  WebWorksRootPath = "";
      // -->
    </script>
  </head>
  <body>
    <div style="text-align: left;">
      <table cellspacing="0" summary="">
        <tr>
          <td>
            <a href="UsingScripting.21.2.html"><img src="images/prev.gif" alt="Previous" border="0" /></a>
          </td>
          <td>
            <a href="UsingScripting.21.4.html"><img src="images/next.gif" alt="Next" border="0" /></a>
          </td>
        </tr>
      </table>
    </div>
    <hr align="left" />
    <blockquote>
      <h3 class="N_h2_Head2"><a name="240489">Choosing between JavaScript and Java</a></h3>
      <p class="b_Body"><a name="240492">Both JavaScript and Java have advantages and disadvantages when writing an event handler. For a developer who is familiar with only one of the two languages, the advantage of using the familiar language is obvious, but for others the decision depends on the report requirements.</a></p>
      <p class="b_Body"><a name="251364">The advantages of using JavaScript to write an event handler include:</a></p>
      <div class="b1_002b_Bullet1WPara_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_002b_Bullet1WPara_inner" style="width: 14.1732pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_002b_Bullet1WPara_inner"><a name="251365">Ease of adding a simple script for a particular event handler</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_i-_Indent1LessLead"><a name="251366">Adding a JavaScript event handler to a report is less complicated than adding an event handler written in Java. To write a JavaScript event handler, there is no need to create a Java environment in Eclipse or to learn the Eclipse Java development process. There is no requirement to specify a package, implement an interface, or know the parameters of the event handler you write.</a></div>
      <div class="N_i_Indent1"><a name="183871">To add a JavaScript event handler, first select the name of the event handler from a drop-down list on the Script tab. Then, type the code.</a></div>
      <div class="b1_002b_Bullet1WPara_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_002b_Bullet1WPara_inner" style="width: 14.1732pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_002b_Bullet1WPara_inner"><a name="183872">Simpler language constructs, looser typing, and less strict language rules</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_i-_Indent1LessLead"><a name="209710">JavaScript is less demanding to code than Java due to its more relaxed requirements.</a></div>
      <p class="b_Body"><a name="209712">The advantages of using Java to write an event handler include:</a></p>
      <div class="b1_002b_Bullet1WPara_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_002b_Bullet1WPara_inner" style="width: 14.1732pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_002b_Bullet1WPara_inner"><a name="209713">Availability of the Eclipse Java development environment</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_i-_Indent1LessLead"><a name="183876">The Eclipse Java development environment is very powerful and includes such features as autocompletion, context sensitive help, keyboard shortcuts, and parameter hints.</a></div>
      <div class="b1_002b_Bullet1WPara_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="b1_002b_Bullet1WPara_inner" style="width: 14.1732pt; white-space: nowrap">
                <img src="Bullet.png" alt="*" border="0" width="6" height="6" />
              </div>
            </td>
            <td width="100%">
              <div class="b1_002b_Bullet1WPara_inner"><a name="183877">Ease of finding and viewing event handlers</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_i-_Indent1LessLead"><a name="246846">All the Java event handlers for a report exist in readily viewable Java files. By contrast, the JavaScript event handlers are embedded in the design and you can view only one handler at a time.</a></div>
    </blockquote>
    <hr align="left" />
    <table align="right" summary="">
      <tr>
        <td class="WebWorks_Company_Name_Bottom">
          <a href="notices.html">(c) Copyright Actuate Corporation 2013</a>
        </td>
      </tr>
    </table>
  </body>
</html>